<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="com.qijia.travel.app.*"  %>
<%@ page import="com.qijia.travel.domain.*"  %>
<%@ page import="com.qijia.travel.common.*"  %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

GuideManager manager = new GuideManager();
Guide guide = (Guide)session.getAttribute(Constants.USER_KEY);
if(guide==null)out.println("<script>alert('请先登录!!');window.location='"+basePath+"';</script>");
guide = manager.getGuideById(guide.getGuideId());
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
<title>后台管理平台--旅游网</title>
<link rel="stylesheet" type="text/css" href="../css/layout.css" />
</head>

<body>
<div id="wrapper">
    <!--头部菜单开始-->
    <jsp:include page="../common/TopMenu.jsp"></jsp:include>
    <!--头部菜单结束-->
	<div id="BreadCrumb">我的位置：基本资料管理 &gt; 修改密码</div>
	<div id="REC_content">
	    <fieldset id="BasicInfo" class="mainField">
		    <legend><span class="title">修改密码</span></legend>
			<div class="innerCon">
			    <!-- begin tab -->
			    <div class="topControl clearfix">
				    <div id="BasicInfoTabCon" class="itemTabCon">
					    <ul id="BasicInfoTabs" class="itemTabs">
					        <li id="dueTab" class="focus"><a href="<%=basePath%>baseInfo/ModifyInfo.jsp" onfocus="this.blur()">修改个人信息</a></li>
						    <li id="onlineTab" class="blur"><a href="<%=basePath%>baseInfo/ModifyPwd.jsp" >修改密码</a></li>
					    </ul>
				    </div>
			    </div>
			    <!-- end tab -->
				<div id="mainListCon">
				    <form action="" method="post">
				    <div id="mLC">
					    <ul>
						    <li><span>姓名：</span><input type="text" name="guide.guideName" class="ipt" value="<%=guide.getGuideName()==null?"":guide.getGuideName()%>"/></li>
							<li><span>性别：</span>
							   <input type="radio" name="guide.guideSex" value="1" <%if(guide.getGuideSex()==null||"1".equals(guide.getGuideSex()))out.print("checked='checked'"); %>/>男
			                   <input type="radio" name="guide.guideSex" value="2" <%if("2".equals(guide.getGuideSex()))out.print("checked='checked'"); %>/>女
			                </li>
							<li><span>手机号：</span><input type="text" name="guide.mobile"  class="ipt" value="<%=guide.getMobile()==null?"":guide.getMobile()%>" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"/></li>
							<li><span>联系电话：</span><input type="text" name="guide.phone" class="ipt" value="<%=guide.getPhone()==null?"":guide.getPhone()%>"/></li>
							<li><span></span><input name="" onclick="updateGuide()" type="button" class="btn_submit" value="确定" /> <input name="" type="reset" class="btn_submit" value="重填" /></li>
						</ul>
					</div>
				    </form>
				</div>
			</div>
		</fieldset>
	</div>
	<jsp:include page="../common/Foot.jsp"></jsp:include>
</div>
<script src="<%=basePath%>dwr/interface/guideManager.js"></script>
<script src="<%=basePath%>dwr/engine.js"></script>
<script src="<%=basePath%>js/jquery.js"></script>
<script>
function updateGuide(){
   var data=new Object;
   data['guideId']=<%=guide.getGuideId()%>;
   $("input[name^=guide]").each(function(e){
       if(this.type=="radio" && !this.checked)return;
       this.name=this.name.substring(this.name.indexOf(".")+1);
       if($.trim(this.value)!="")
       data[this.name]=this.value;
   });
   $("select[name^=guide]").each(function(e){
       this.name=this.name.substring(this.name.indexOf(".")+1);
       if($.trim(this.value)!="")
       data[this.name]=$(this).val();
   });
   guideManager.updateGuide(data,function(e){
     alert("修改成功!");
     window.location.reload();
   });
 }
</script>
</body>
</html>
